//
//  MYXNewReleaseTopViewCell.m
//  meiyinxiang
//
//  Created by 陈李飞 on 2017/11/27.
//  Copyright © 2017年 hbjApple. All rights reserved.
//我的发布顶部界面

#import "MYXNewReleaseTopViewCell.h"
#import "UIView+Additions.h"
#import "UIImageView+LBBlurredImage.h"
@implementation MYXNewReleaseTopViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    if ([MYXMemberMdel sharedInstance].userinfo.image) {
        [self.iconImageView sd_setImageWithURL:[NSURL URLWithString:[MYXMemberMdel sharedInstance].userinfo.image] placeholderImage:[UIImage imageNamed:@"AppIcon"]];
        self.iconImageView.layer.masksToBounds = YES;
        self.iconImageView.contentMode = UIViewContentModeScaleAspectFill;
        [self.bgImgaeView sd_setImageWithURL:[NSURL URLWithString:[MYXMemberMdel sharedInstance].userinfo.image] placeholderImage:[UIImage imageNamed:@"AppIcon"]];
        // 方法2,对背景图片进行毛玻璃效果处理,参数blurRadius默认是20,可指定,最后一个参数block回调可为nil
        [self.bgImgaeView setImageToBlur:self.bgImgaeView.image blurRadius:5 completionBlock:nil];
        self.bgImgaeView.contentMode = UIViewContentModeScaleAspectFill;
        self.bgImgaeView.layer.masksToBounds = YES;
        self.bgImgaeView.userInteractionEnabled = YES;
    }else{
        self.iconImageView.image =[UIImage imageNamed:@"AppIcon_"];
    }
    if ([MYXMemberMdel sharedInstance].userinfo.username.length>0) {
         self.nickNameLabel.text =[MYXMemberMdel sharedInstance].userinfo.username;
    }else{
          self.nickNameLabel.text =[MYXMemberMdel sharedInstance].userinfo.phone;
    }
    //签名
    self.detialLabel.text = [MYXMemberMdel sharedInstance].userinfo.signature;
    //性别
    if ([[MYXMemberMdel sharedInstance].userinfo.sex isEqualToString:@"1"]) {
        self.sexImageView.image = [UIImage imageNamed:@"men"];
    }else{
        self.sexImageView.image = [UIImage imageNamed:@"women"];
    }
}
- (IBAction)BackButt:(id)sender {
     [[self viewController].navigationController popViewControllerAnimated:YES];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
